<?php // $Id: export_form.php, 29-08-2010 afterlastangel

require_once($CFG->libdir.'/formslib.php');
class mod_diemrenluyen_export_form extends moodleform {
    function  definition() {
//        parent::definition();
        global $CFG, $USER;
        $mform    =& $this->_form;
        $course        = $this->_customdata['course'];
        $cm            = $this->_customdata['cm'];
        $modcontext    = $this->_customdata['modcontext'];
        $mform->addElement('header', 'general', get_string('export','diemrenluyen'));
//        $mform->setHelpButton('general', array('export', get_string('export','quiz'), 'attforblock'));
        $groupmode=groups_get_activity_groupmode($cm);
        $groups = groups_get_activity_allowed_groups($cm, $USER->id);
		if ($groupmode == VISIBLEGROUPS or has_capability('moodle/site:accessallgroups', $modcontext)) {
			$grouplist[0] = get_string('allparticipants');
		}
		if ($groups) {
            foreach ($groups as $group) {
                $grouplist[$group->id] = $group->name;
            }
        }
        $mform->addElement('select', 'group', get_string('group','diemrenluyen'), $grouplist);
        $mform->addElement('date_selector', 'sessionenddate', get_string('endofperiod','diemrenluyen'));
        $mform->addElement('select', 'format', get_string('format','diemrenluyen'),
        					array('excel' => get_string('downloadexcel','diemrenluyen'),
        						  'ooo' => get_string('downloadooo','diemrenluyen'),
        						  'text' => get_string('downloadtext','diemrenluyen')
        					));
        $submit_string = get_string('ok','diemrenluyen');
        $this->add_action_buttons(false, $submit_string);
        $mform->addElement('hidden', 'id', $cm->id);

    }
}
?>
